﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Topshelf;

namespace Ttifa.CronScheduler
{
    class Program
    {
        static void Main(string[] args)
        {
            HostFactory.Run(x =>
            {
                //x.Service<QuartzDemo>(s =>
                //{
                //    s.ConstructUsing(name => new QuartzDemo());
                //    s.WhenStarted(tc => tc.Start());
                //    s.WhenStopped(tc => tc.Stop());
                //});
                x.Service<Demo2>(s =>
                {
                    s.ConstructUsing(name => new Demo2());
                    s.WhenStarted(tc => tc.Start());
                    s.WhenStopped(tc => tc.Stop());
                });
                x.RunAsLocalSystem();

                x.SetDescription("Ttifa.CronScheduler Host");
                x.SetDisplayName("Ttifa.CronScheduler");
                x.SetServiceName("Ttifa.CronScheduler");
            });
        }
    }
}
